package com.lx.config;

import org.springframework.batch.core.configuration.annotation.DefaultBatchConfigurer;
import org.springframework.batch.core.configuration.annotation.EnableBatchProcessing;
import org.springframework.context.annotation.Configuration;

import javax.sql.DataSource;

/**
 * @author lixing
 * @date 2021/7/11 19:18
 */
@Configuration
@EnableBatchProcessing
public class BatchConfig extends DefaultBatchConfigurer {

    /**
     * 通过扩展DefaultBatchConfigurer类来解决此问题，以便它忽略任何DataSource，因此它将配置基于地图的JobRepository
     * @param dataSource
     */
    @Override
    public void setDataSource(DataSource dataSource) {
        //This BatchConfigurer ignores any DataSource
    }
}